<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 400px;
        height: 300px;
        perspective: 1000;
        /* 指定嵌套元素如何在3D空间中呈现 */
        transform-style: preserve-3d;
        .bd {
          transition: 0.6s;
          transform-style: preserve-3d;
          position: relative;
          .one {
            width: 400px;
            height: 300px;
            top: 0px;
            left: 0px;
            position: absolute;
            z-index: 1;
            /* 隐藏背面 */
            backface-visibility: hidden;
          }
          .two {
            width: 400px;
            height: 300px;
            top: 0px;
            left: 0px;
            position: absolute;
            backface-visibility: hidden;
            transform: rotateY(-180deg);
          }
        }
      }
      .box:hover .bd {
        transform: rotateY(180deg);
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="bd">
        <div class="one">
          <img src="./z.png" />
        </div>
        <div class="two">
          <img src="./f.png" />
        </div>
      </div>
    </div>
  </body>
</html>
